<?php

namespace app\adminmini\service;

use app\adminmini\model\Profit;

class ProfitService extends BaseService
{
    public function __construct()
    {
        $this->model = new Profit();
    }

    public function getList()
    {
        $data = request()->param();
        // 查询条件
        $map = [];
        if (isset($data['add_time'])) {
            if ($data['add_time'] != "") {
                $add_time = strtotime($data['add_time']);
                $map[] = ['create_time', '>=', $add_time];
            }
        }
        if (isset($data['end_time'])) {
            if ($data['end_time'] != "") {
                $add_time = strtotime($data['end_time']);
                $map[] = ['create_time', '<=', $add_time];
            }

        }


        $map[] = ['store_id', '=', $this->userId()];

        return parent::getList($map); // TODO: Change the autogenerated stub
    }
}